home *** CD-ROM | disk | FTP | other *** search
- package symantec.itools.db.net;
-
- import java.io.DataInputStream;
- import java.io.DataOutputStream;
- import java.io.IOException;
- import symjava.sql.SQLException;
-
- public class Binary extends BinaryField {
- Binary() {
- }
-
- int getType() {
- return 70;
- }
-
- void read(DataInputStream is) throws SQLException, IOException, ErrorException {
- super.read(is);
- if (!super._null) {
- ServerObject obj = (ServerObject)NetClass.getNextObject(is);
- if (obj.getType() == 51) {
- super._binData = ((NetData)obj).getBytes();
- } else {
- ((ServerObject)this).onObjectError(obj);
- }
- }
-
- ServerObject obj = (ServerObject)NetClass.getNextObject(is);
- if (obj.getType() != 50) {
- ((ServerObject)this).onObjectError(obj);
- }
-
- }
-
- void write(DataOutputStream os) throws IOException {
- super.write(os);
- NetData d = new NetData(super._binData);
- d.write(os);
- EOT eot = new EOT();
- eot.write(os);
- }
-
- public int getSQLType() {
- return -2;
- }
-
- public Object getObject() throws SQLException {
- return ((BinaryField)this).getBytes();
- }
-
- public void setObject(Object obj) throws SQLException {
- ((BinaryField)this).setBytes((byte[])obj);
- }
- }
-